﻿using System.IO;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Windows;

namespace AutoLoL.Shared
{
    public class Constants
    {
        static Constants()
        {
            APPLICATION_VERSION = Assembly.GetEntryAssembly().GetName().Version;
            APPLICATION_EXECUTEABLE = Assembly.GetEntryAssembly().Location;

            AUTOCHAT_MODIFIER_KEYS = new Dictionary<int, string>();
            AUTOCHAT_MODIFIER_KEYS.Add(162, "Left Control");
            AUTOCHAT_MODIFIER_KEYS.Add(164, "Left Alt");
            AUTOCHAT_MODIFIER_KEYS.Add(160, "Left Shift");
            AUTOCHAT_MODIFIER_KEYS.Add(163, "Right Control");
            AUTOCHAT_MODIFIER_KEYS.Add(165, "Right Alt");
            AUTOCHAT_MODIFIER_KEYS.Add(161, "Right Shift");

            AUTOCHAT_KEYS = new Dictionary<int[], string>();
            AUTOCHAT_KEYS.Add(new int[] { 49, 50, 51, 52, 53, 54 }, "1 2 3 4 5 6");
            AUTOCHAT_KEYS.Add(new int[] { 81, 87, 69, 82, 84, 89 }, "a s d z x c (Qwerty)");
            AUTOCHAT_KEYS.Add(new int[] { 65, 90, 69, 82, 84, 89 }, "q s d w x c (Azerty)");
            AUTOCHAT_KEYS.Add(new int[] { 81, 87, 69, 82, 84, 90 }, "a s d y x c (Qwertz)");
            AUTOCHAT_KEYS.Add(new int[] { 97, 98, 99, 100, 101, 102 }, "1 2 3 4 5 6 (Numpad)");

            #region Directories & Files
            APPLICATION_DIRECTORY = Path.GetDirectoryName(APPLICATION_EXECUTEABLE);
            {
                BUILDS_DIRECTORY = Path.Combine(APPLICATION_DIRECTORY, "Builds");
                DATA_DIRECTORY = Path.Combine(APPLICATION_DIRECTORY, "Data");
                {
                    GAME_DIRECTORY = Path.Combine(DATA_DIRECTORY, "Game");
                    {
                        MASTERIES_DIRECTORY = Path.Combine(GAME_DIRECTORY, "Masteries");
                        {
                            MASTERIES_XML_FILE = Path.Combine(MASTERIES_DIRECTORY, "Masteries.xml");
                        }
                        SPELLS_DIRECTORY = Path.Combine(GAME_DIRECTORY, "Spells");
                        {
                            SPELLS_XML_FILE = Path.Combine(SPELLS_DIRECTORY, "Spells.xml");
                        }
                    }
                    IMAGES_DIRECTORY = Path.Combine(DATA_DIRECTORY, "Images");
                    SOUNDS_DIRECTORY = Path.Combine(DATA_DIRECTORY, "Sounds");
                    {
                        ERROR_SOUND = Path.Combine(SOUNDS_DIRECTORY, "Chord.wav");
                    }
                    UTILITIES_DIRECTORY = Path.Combine(DATA_DIRECTORY, "Utilities");
                    {
                        UTILITIES_NCONVERT_EXE = Path.Combine(UTILITIES_DIRECTORY, "NConvert", "nconvert.exe");
                        UTILITIES_LOLSKINTOOL_EXE = Path.Combine(UTILITIES_DIRECTORY, "lolskintool_0.4.07", "lolskintool.exe");
                    }
                    XML_DIRECTORY = Path.Combine(DATA_DIRECTORY, "XML");
                    {
                        VERSION_XML_FILE = Path.Combine(XML_DIRECTORY, "Version.xml");
                    }

                }
                TEMP_DIRECTORY = Path.Combine(APPLICATION_DIRECTORY, "Temp");
            }
            #endregion
        }

        public static bool IS_DEBUGGING_ENABLED = false;

        public const double BASE_CLIENT_WIDTH = 1280.0;
        public const double BASE_CLIENT_HEIGHT = 800.0;
        public const double MIN_CLIENT_WIDTH = 1024.0;
        public const double MIN_CLIENT_HEIGHT = 640.0;

        public const string NEWS_PAGE_URL = "http://codingquirks.com/apps/autolol/News2.htm";
        public static string UPDATES_URL = "http://codingquirks.com/apps/autolol/updates/Updates2.xml?nocache=" + DateTime.Now.ToShortDateString();

        public static readonly Dictionary<int, string> AUTOCHAT_MODIFIER_KEYS;
        public static readonly Dictionary<int[], string> AUTOCHAT_KEYS;
        public const int AUTOCHAT_MIN_INTERVAL = 2;

        public const string DEFAULT_BUILD_GUIDE = @"[h1]Guide[/h1]
[br]
[b]Welcome summoner![/b][br]
[br]
You can use this window to add a [i]Guide[/i] to your [i]Champion Build[/i].[br]
We support some [url=http://en.wikipedia.org/wiki/BBCode]BBCode[/url] tags you can use to [color=red][size=1]make[/size][/color] [color=blue][size=2]your[/size][/color] [color=green][size=3]guide[/size][/color] [color=orange][size=4]look[/size][/color] [color=pink][size=5]awesome![/size][/color][br]
[br]
Click the [i]Edit[/i] button to start editing your guide right now or press the [i]Help[/i] button if you need help.[br]
[br]
Have fun![br]
The AutoLoL team";

        public static readonly Version APPLICATION_VERSION;
        public static readonly string APPLICATION_EXECUTEABLE;
        public static readonly string APPLICATION_DIRECTORY;
        public static readonly string BUILDS_DIRECTORY;
        public static readonly string DATA_DIRECTORY;
        public static readonly string IMAGES_DIRECTORY;
        public static readonly string SOUNDS_DIRECTORY;
        public static readonly string ERROR_SOUND;
        public static readonly string UTILITIES_DIRECTORY;
        public static readonly string UTILITIES_NCONVERT_EXE;
        public static readonly string UTILITIES_LOLSKINTOOL_EXE;
        public static readonly string XML_DIRECTORY;
        public static readonly string VERSION_XML_FILE;
        public static readonly string GAME_DIRECTORY;
        public static readonly string CHAMPIONS_DIRECTORY;
        public static readonly string CHAMPIONS_XML_FILE;
        public static readonly string ITEMS_DIRECTORY;
        public static readonly string ITEMS_XML_FILE;
        public static readonly string MASTERIES_DIRECTORY;
        public static readonly string MASTERIES_XML_FILE;
        public static readonly string SPELLS_DIRECTORY;
        public static readonly string SPELLS_XML_FILE;
        public static readonly string TEMP_DIRECTORY;
    }
}
